import  {url} from "./index";
import axios from 'axios';

//axios  返回promise对象
//使用async 与await 代替promise  异步变为同步
//登录
export const adminLogin=async ( data)=>{
        let resLogin=await axios({
            method:"post",
            url:url+"/login",
            data
        });
        return  resLogin.data
}


//token
export const getToken = async () => {
    let res = await axios({
        method:"get",
        url:url + "/getToken"
    });
    return res.data;
}